# 元组
dimensions = (200, 50)

# dimensions[0] = 1 # 元组内的值无法修改

print(dimensions)
print(dimensions[0])
print(dimensions[1])

dimensions = (10, 20) # 但对元组整体是可以重新赋值的
print(dimensions)
print(dimensions[0])
print(dimensions[1])

dimensions = list(range(2)) # 对元组赋其他类型值，会发生强转
print(dimensions)

my_t = 3, # 元组是由,标识的，()只是让其看起来更整洁、清晰，并无特殊作用
# 3, 等价于 (3,) |||| (3)等价于3
print(my_t) # 输出为(3,)

for dimension in dimensions: # 元组的遍历和列表一样
    print(dimension, end=' ')
print()